<template>
    <div>
        <el-button type="success" @click="convertToSpeech('speak-tts语音播报')">speak-tts语音播报</el-button>

    </div>
  </template>
  <script>
const googleTTS = require('google-tts-api');
// es6
  export default {
    name: "TTS",
    data() {
      return {
        speech: null,
      };
    },
    mounted() {
    },
    methods: {
      convertMathSymbolsToWords(text) {
  return text
    .replace(/\+/g, ' plus ')
    .replace(/-/g, ' minus ')
    .replace(/\*/g, ' times ')
    .replace(/\//g, ' divided by ')
    .replace(/=/g, ' equals ');
},
      convertToSpeech(text) {
        let url = googleTTS.getAudioUrl('12', { lang: 'zh-CN' })
        console.log(url)
}
    },
  };
  </script>
  
  <style scoped>
  </style>